package com.ruoyi.project.constant.statuEnum;

/**
 * @program: lvhang
 * @description: 短信类型
 * @author: Mr.Wang
 * @create: 2020-08-04 16:37
 **/
public enum SmsTypeEnum {

    LOGIN(0,"登录","LOGIN_"),
    XIUGAI_MIMA(1,"修改密码","UPDATE_PWD_"),
    XIADAN(2,"下单成功","");

    private final Integer code;
    private final String info;
    //发送短信时的token前缀
    private final String preToken;

    SmsTypeEnum(Integer code, String info, String preToken)
    {
        this.code = code;
        this.info = info;
        this.preToken = preToken;
    }

    public Integer getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }

    public String getPreToken()
    {
        return preToken;
    }


    public static String getValue(Integer code) {
        for (SmsTypeEnum ele : values()) {
            if(ele.getCode() == code) return ele.getInfo();
        }
        return null;
    }

    public static SmsTypeEnum vauleOf(Integer code) {
        for (SmsTypeEnum ele : values()) {
            if(ele.getCode() == code) return ele;
        }
        return null;
    }


}
